<template>
	<view>
		<!-- 核酸检测 -->
		<text class="tit">请选择就诊人</text>
		<view class="box" @click="tiaozhuan1(v.patients_id)" v-for="v in binData">
			<view class="top">
				<view>{{v.patients_name}}
					<text class="tag" v-if="v.patients_department==1">本人</text>
					<text class="tag" v-else-if="v.patients_department==2">父母</text>
					
				</view>
				<p class="pp">{{v.patients_id_number}}</p>
			</view>


			<view class="right"><text>默认就诊人</text></view>

		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				binData: {},
			
			}
		},

		methods: {
			getall() {
				uni.request({
					url: "http://localhost:3000/selecttable",
					data:{id:1},
					success: (res) => {
						this.binData = res.data.data
						console.log(this.binData)
					}
				})

			},
			tiaozhuan1(p) {
				let obj1 =this.binData
				uni.setStorageSync('binData',obj1);
				uni.navigateTo({
					url: `/pages/home/hesuandetect/applyfor/applyfor?id=${p}`
				})
			},
			// tiaozhuan2() {
			// 	uni.navigateTo({
			// 		url: "/pages/home/hesuandetect/applyfor/applyfor"
			// 	})
			// }
		},
		onLoad() {
			this.getall()
		}
	}
</script>

<style lang="scss">
	.box {
		display: flex;
		justify-content: space-between;
		padding-top: 30rpx;
		background-color: #f5f9ff;
		width: 700rpx;
		height: 150rpx;
		margin-left: 20rpx;
		margin-bottom: 25rpx;
		margin-top: 25rpx;

		.right {
			display: flex;

			text {
				font-size: 12px;
				color: #939598;
				padding-right: 25rpx;
				box-sizing: border-box;
			}

		}

		.tag {
			display: inline-block;
			width: 80rpx;
			height: 35rpx;
			background: #e2edfe;
			color: #4f9aff;
			text-align: center;
			border-radius: 20rpx;
			font-size: 20rpx;
		}
	}

	.top {
		padding-left: 25rpx;
		box-sizing: border-box;

		.pp {
			margin-top: 20rpx;
			font-size: 12px;
			color: #939598;
		}
	}

	.tit {
		margin-left: 25rpx;
	}
</style>
